package com.zmq.pic.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * 用户详细信息 entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "pic_userinfo", catalog = "pic")
public class PicUserinfo extends com.zmq.pic.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 8003291274801649584L;
	// Fields

	private Long id;
	private PicUser picUser;
	/**
	 * 姓名
	 */
	private String name;
	/**
	 * 性别
	 */
	private Integer gender;
	/**
	 * 邮箱
	 */
	private String email;
	/**
	 * 手机
	 */
	private String mobile;

	// Constructors

	/** default constructor */
	public PicUserinfo() {
	}

	/** full constructor */
	public PicUserinfo(PicUser picUser, String name, Integer gender,
			String email, String mobile) {
		this.picUser = picUser;
		this.name = name;
		this.gender = gender;
		this.email = email;
		this.mobile = mobile;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", unique = true)
	public PicUser getPicUser() {
		return this.picUser;
	}

	public void setPicUser(PicUser picUser) {
		this.picUser = picUser;
	}

	@Column(name = "NAME", length = 64)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "GENDER")
	public Integer getGender() {
		return this.gender;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	@Column(name = "EMAIL", length = 64)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "MOBILE", length = 64)
	public String getMobile() {
		return this.mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Override
	public String toString() {
		return "PicUserinfo [email=" + email + ", gender=" + gender + ", id="
				+ id + ", mobile=" + mobile + ", name=" + name + ", picUser="
				+ picUser + "]";
	}

}